<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="tr09" uri="http://www.51i-star.com/mytags" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-3.1.0.min.js"></script>
<script type="text/javascript">
	function resetPassword(mid){
		//reset_password?mid=5&x=10
		$.get("reset_password", {mid: mid}, function(){
			alert("密码已重置");			
		});
	}
</script>
<title>会员列表</title>
<style type="text/css">
	*{
		font-size: 14px;
	}
	
	img{
		border: none;
	}
	
	.t{
		border-collapse: collapse;
		border: none;
		width: 100%;
	}
	
	.t td{
		text-align: center;
	}
	
	th,td{
		padding: 8px;
		border: none;
		border-bottom: 1px solid #CCC;
	}
	
	th{
		color: gray;
	}
	
	td{
		border-bottom: 1px dashed #CCC;
	}
	
	.border_bottom_empty{
		border-bottom: none;
	}
	
	.pager{
		text-align: right;
		padding: 10px;
	}
	
	.pager a{
		text-decoration: none;
		color: gray;
	}
	
	.pager span{
		font-size: 12px;
		color: gray;
	}
</style>
</head>
<body>
	<table border="1" class="t">
		<tr>
			<th class="border_bottom_empty"></th>
			<th>姓名</th>
			<th>性别</th>
			<th>电话</th>
			<th>出生日期</th>
			<th>注册时间</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list}" var="m">
			<tr>
				<td width="10%" class="border_bottom_empty">
					<img alt="头像" src="${empty m.headerImage ? 'imgs/default_header.png' : m.headerImage}">
				</td>
				<td width="14%">${m.realName}</td>
				<td width="10%">${m.sex}</td>
				<td width="14%">${m.phone}</td>
				<td width="18%"><fmt:formatDate value="${m.birthday}" pattern="yyyy年MM月dd日"/> </td>
				<td width="20%"><fmt:formatDate value="${m.regTime}" pattern="yyyy-MM-dd HH:mm:ss"/> </td>
				<td>
					<a href="init_member?mid=${m.mid}&curpage=${param.curpage}"><img title="完善资料" src="imgs/edit.png"></a>
					<a href="javascript:resetPassword(${m.mid})"><img title="重置密码" src="imgs/reset_password.png"></a>
				</td>
			</tr>
		</c:forEach>
	</table>
	<div class="pager">
		<tr09:pager url="member_list" pagesize="2" 
			total="${total}" curpage="${param.curpage}"/>
	</div>
</body>
</html>